import QtQuick 1.1
import com.meego 1.0
import "CommomUtil.js" as Util
import "Citys.js" as CityUtil

Item {
    id: city_item

    property alias text: label.text

    property int fontSize: 18

    property string cityId: "1"

    Rectangle {
        id: item_rect
        anchors.fill: parent
        opacity: 0
        color: "#000000"
    }

    Text {
        id: label
        anchors.fill: parent
        horizontalAlignment : Text.AlignHCenter
        verticalAlignment: Text.AlignVCenter
        color: "#7a7575"
        font.bold: true
        font.pointSize: fontSize
    }

    MouseArea{
        id: itemMouseArea
        anchors.fill: parent
        onClicked: { // 返回到主页面, 并刷新主页面城市
            CityUtil.updateCurrentCigy(city_item.cityId, city_item.text);
            pageStack.pop();

        }
    }

    states: [
        State {
            name: 'pressed'; when: itemMouseArea.pressed
            PropertyChanges { target: item_rect; focus: true; opacity: 0.2}
        }
    ]
}
